package com.cui.assess.action;

import com.cui.assess.model.User;
import com.opensymphony.xwork2.ActionSupport;

public class LoginAction extends ActionSupport{

	private boolean success;
	private String message;
	private User user;
	
	public String execute() throws Exception{
		if(user.getUsername().equals("admin")&&user.getPassword().equals("admin")){
			this.success = true;
			this.message = "你的账号是："+user.getUsername()+"密码为："+user.getPassword();
			}else{

			this.success = false;
			this.message = "对不起，未经授权的用户不能登录该系统！";
			} 	  
		return "success";
	}

	public boolean isSuccess() {
		return success;
	}

	public void setSuccess(boolean success) {
		this.success = success;
	}

	public String getMessage() {
		return message;
	}

	public void setMessage(String message) {
		this.message = message;
	}

	public User getUser() {
		return user;
	}

	public void setUser(User user) {
		this.user = user;
	}
	
	
}
